home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 43 / Mac Magazin and MacEasy Magazine CD - Issue 43.iso / Software / Mobiles Büro / Newton / Newton Entwickler / DIL 2.0 Mac OS ƒ / Headers / CDIL.h next >
Text File  |  1997-09-19  |  3KB  |  93 lines

  1. /*
  2.     File:        CDIL.h, v2.0a2
  3.  
  4.     Contains:    Public interface to the Desktop Integration Library
  5.  
  6.     Copyright:    Apple Computer, Inc. 1997, all rights reserved.
  7. */
  8.  
  9. #ifndef __CDIL_H
  10. #define __CDIL_H
  11.  
  12. #include "DIL.h"
  13.  
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17.  
  18. /* --- CDIL error numbers --- */
  19.  
  20. #define kCD_CDILNotInitialized            (kCD_ErrorBase - 1)
  21. #define kCD_ServiceNotSupported            (kCD_ErrorBase - 2)
  22. #define kCD_BadPipeState                (kCD_ErrorBase - 3)
  23. #define kCD_Timeout                        (kCD_ErrorBase - 4)
  24. #define kCD_PipeDisconnected            (kCD_ErrorBase - 5)
  25. #define kCD_IndexOutOfRange                (kCD_ErrorBase - 6)
  26. #define kCD_BufferTooSmall                (kCD_ErrorBase - 7)
  27. #define kCD_PlatformError                (kCD_ErrorBase - 8)
  28.  
  29. #define kCD_TCPCantFindLibraryFns        (kCD_ErrorBase - 20)
  30. #define kCD_TCPInsufficientVersion        (kCD_ErrorBase - 21)
  31. #define kCD_TCPNoSockets                (kCD_ErrorBase - 22)
  32.  
  33. typedef enum CD_State
  34. {
  35.     kCD_Unknown,
  36.     kCD_Uninitialized,
  37.     kCD_Disconnected,
  38.     kCD_Listening,
  39.     kCD_ConnectPending,
  40.     kCD_Connected,
  41.     kCD_DisconnectPending
  42. } CD_State;
  43.  
  44. /*
  45. **    Values that can be passed to CD_SetTimeout as timeout values.
  46. */
  47.  
  48. #define kCD_DefaultTimeout                (-1)        /* 30 seconds            */
  49. #define kCD_NoTimeout                    (-2)        /* many more seconds    */
  50.  
  51.  
  52. DECLARE_DIL_HANDLE(CD_Handle);
  53.  
  54. DILAPI DIL_Error    CD_Startup            (void);
  55. DILAPI DIL_Error    CD_Shutdown            (void);
  56.  
  57. DILAPI DIL_Error    CD_HasADSP            (void);
  58. DILAPI DIL_Error    CD_HasCTB            (const char* toolName);
  59. DILAPI DIL_Error    CD_HasMNPSerial        (void);
  60. DILAPI DIL_Error    CD_HasTCP            (void);
  61.  
  62. DILAPI DIL_Error    CD_GetSerialPortName(long index, char* buffer, long* bufLen);
  63.  
  64. DILAPI DIL_Error    CD_CreateADSP        (CD_Handle*, const char* name, const char* type);
  65. DILAPI DIL_Error    CD_CreateCTB        (CD_Handle*, const char* toolName, const char* configString);
  66. DILAPI DIL_Error    CD_CreateMNPSerial    (CD_Handle*, long port, long baud);
  67. DILAPI DIL_Error    CD_CreateTCP        (CD_Handle*, long port);
  68.  
  69. DILAPI DIL_Error    CD_Dispose            (CD_Handle);
  70.  
  71. DILAPI DIL_Error    CD_Disconnect        (CD_Handle);
  72. DILAPI DIL_Error    CD_StartListening    (CD_Handle);
  73. DILAPI DIL_Error    CD_Accept            (CD_Handle);
  74. DILAPI DIL_Error    CD_Read                (CD_Handle, void* p, long count);
  75. DILAPI DIL_Error    CD_BytesAvailable    (CD_Handle, long* count);
  76. DILAPI DIL_Error    CD_Write            (CD_Handle, const void* p, long count);
  77. DILAPI DIL_Error    CD_FlushOutput        (CD_Handle);
  78. DILAPI DIL_Error    CD_Idle                (CD_Handle);
  79.  
  80. DILAPI CD_State    CD_GetState            (CD_Handle);
  81.  
  82. DILAPI DIL_Error    CD_SetTimeout        (CD_Handle, long timeoutInSecs);
  83.  
  84. DILAPI long        CD_GetPlatformError    (CD_Handle);
  85.  
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89.  
  90. #endif    /* __CDIL_H */
  91.  
  92.  
  93.